<template>
  <div>
    <el-card>
      <div class="changeLanguage">
        <el-radio v-model="language" label="1" border>{{$t('l.Chinese')}}</el-radio>
        <el-radio v-model="language" label="2" border>{{$t('l.English')}}</el-radio>
        <el-radio v-model="language" label="3" border>{{$t('l.Japanese')}}</el-radio>
        <el-radio v-model="language" label="4" border>{{$t('l.Spanish')}}</el-radio>
      </div>
      <el-row style="margin-top: 20px;">
        <el-button size="small">{{$t('e.defaultBtn')}}</el-button>
        <el-button type="primary" size="small">{{$t('e.mainBtn')}}</el-button>
        <el-button type="success" size="small">{{$t('e.successBtn')}}</el-button>
        <el-button type="info" size="small">{{$t('e.infoBtn')}}</el-button>
        <el-button type="warning" size="small">{{$t('e.warnBtn')}}</el-button>
        <el-button type="danger" size="small">{{$t('e.dangerBtn')}}</el-button>
      </el-row>
      <el-input v-model="input" :placeholder="$t('e.defaultBtn')"></el-input>
      <div class="description">
        <div>
          <p class="description-item">
            <span>{{$t('k.name')}}：</span>
            <span class="description-content">{{$t('v.name')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.age')}}：</span>
            <span class="description-content">{{$t('v.age')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.gender')}}：</span>
            <span class="description-content">{{$t('v.gender')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.degree')}}：</span>
            <span class="description-content">{{$t('v.degree')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.interes')}}：</span>
            <span class="description-content">{{$t('v.interes')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.workExperience')}}：</span>
            <span class="description-content">{{$t('v.workExperience')}}</span>
          </p>
          <p class="description-item">
            <span>{{$t('k.briefIntroduction')}}：</span>
            <span class="description-content" v-html="$t('v.briefIntroduction')"></span>
          </p>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      language: '1',
      input: ''
    }
  },
  watch: {
    language(val) {
      if(val === '1') {
        this.$i18n.locale = 'zh'
        return
      }
      if(val === '2') {
        this.$i18n.locale = 'en'
        return
      }
      if(val === '3') {
        this.$i18n.locale = 'ja'
        return
      }
      if(val === '4') {
        this.$i18n.locale = 'es'
      }
    }
  }
}
</script>

<style scoped>
  .changeLanguage {
    width: 70%;
    margin: 10px auto;
    padding: 20px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bbb;
  }
  .description-content {
    padding: 0 5px;
    background-color: #005500;
    line-height: 25px;
    color: #ffffff;
   text-decoration: underline;
  }
  .description-content::selection {
    background-color: #000;
  }
  .description-item {
    margin: 10px 0;
  }
</style>
